<?php

/**
 * Links form.
 *
 * @package    explications_informatiques
 * @subpackage form
 * @author     Guimezanes Cyrille
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class LinksForm extends BaseLinksForm
{
  public function configure()
  {
	  unset($this["last_in"],$this["last_ip"],$this["online"]);
	  $this->disableLocalCSRFProtection();
  }
  public function setup()
  {
	  $this->setWidgets(array(
      
      'titre'           => new sfWidgetFormInputText(array(),array("size" => 60)),
	  'url'           => new sfWidgetFormInputText(array(),array("size" => 60)),
	  'nbclick'           => new sfWidgetFormInputText(array(),array("size" => 60)),
	  'nbentree'           => new sfWidgetFormInputText(array(),array("size" => 60)),
	  'description'		   => new sfWidgetFormTextarea(array(), array("cols" => 77,"rows"=>5)),
      'img'           => new sfWidgetFormInputText(array(),array("size" => 60)),
      'token'           => new sfWidgetFormInputText(array(),array("size" => 60)),
	  'email'           => new sfWidgetFormInputText(array(),array("size" => 60)),
      'id'   		   => new sfWidgetFormInputHidden(),	
	));
	
	$this->widgetSchema->setNameFormat('articles[%s]');
	
	$this->setValidators(array(
      'titre'   => new sfValidatorString(array('required' => true,"max_length" => 150)),
	  'url'   => new sfValidatorString(array('required' => true,"max_length" => 150)),
	  'nbclick'   => new sfValidatorString(array('required' => true,"max_length" => 150)),
      'nbentree'   => new sfValidatorString(array('required' => true,"max_length" => 150)),
      'description' => new sfValidatorString(array('required' => true)),
      'img'   => new sfValidatorString(array('required' => true,"max_length" => 150)),
	  'token'   => new sfValidatorString(array('required' => true,"max_length" => 150)),
	  'email'   => new sfValidatorString(array('required' => true,"max_length" => 150)),
      'id' => new sfValidatorString(array('required' => false)),
    ));
	
	$this->widgetSchema->setLabels(array(
    
	  'titre'		   => "Le nom du partenaire. Transformé en lien avec le champs URL",
	  'url'	   => "URL du partenaire",
	  'nbclick'		   => "Le nombre de clic de sortie déjà effectué ... WE ARE GOD!",
	  'nbentree'		   => "Le nombre de clic d'entrée déjà effectué ... WE ARE GOD!",
	  'description'		   => "Texte présentatif",
	  'img'		   => "Logo du partenaire",
	  'token'		   => "Token unique pour lien de partage",
	  'email'		   => "email de contact de parenaire",
	  
    ));

    //$this->widgetSchema->setFormFormatterName('list');
  }
}
